package com.lucifer.cloud.boot.blog.domin.dto.star;

import com.lucifer.cloud.boot.blog.domin.type.BlogConstant;
import com.lucifer.cloud.boot.blog.domin.bo.Star;
import com.lucifer.cloud.boot.blog.util.GenerateUtils;

/**
 * @author lucifer
 * @date 2023/12/30 15:36
 */
public class StarConverter {

    public static Star converterReq2Star(Long userId, String uid, String createdUserId,Integer star_type, Integer type){
        Star star = new Star();
        star = (Star)GenerateUtils.generateFiledValue(star);
        star.setCreated_user_id(Long.parseLong(createdUserId));
        star.setUser_id(userId);
        star.setStar_id(Long.parseLong(uid));
        star.setStar_type(BlogConstant.ASC_STAR_TYPE.equals(star_type) ? true:false);
        star.setType(type);
        return star;
    }
}
